package com.zr.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.service.BanjiServiceHyx;
import com.zr.serviceImpl.BanjiServiceImplHyx;

import net.sf.json.JSONArray;

public class GetAllBanjiControllerHyx extends HttpServlet{

	BanjiServiceHyx bService = new BanjiServiceImplHyx();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		resp.setCharacterEncoding("UTF-8");
		JSONArray js = bService.getAllBname();	
		PrintWriter pw = resp.getWriter();
		pw.write(js.toString());
		pw.flush();
		pw.close();
		
	}
}
